package com.zzxz.practicaltrainingsys.service.impl;

import com.zzxz.practicaltrainingsys.entity.College;
import com.zzxz.practicaltrainingsys.mapper.CollegeMapper;
import com.zzxz.practicaltrainingsys.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollegeServiceImpl implements CollegeService {
    @Autowired
    private CollegeMapper collegeMapper;

    @Override
    public List<College> getCollege() {
        return collegeMapper.getCollege();
    }

    @Override
    public boolean addCollege(College college) {
        return collegeMapper.addCollege(college) > 0;
    }

    @Override
    public College getCollegeById(Integer college_id) {
        return collegeMapper.getCollegeById(college_id);
    }

    @Override
    public int updateCollege(College college) {
        return collegeMapper.updateCollege(college);
    }

    @Override
    public List<College> getCollegeBySchoolId(Integer school_id) {
        return collegeMapper.getCollegeBySchoolId(school_id);
    }


}